home *** CD-ROM | disk | FTP | other *** search
/ Aminet 30 / Aminet 30 (1999)(Schatztruhe)[!][Apr 1999].iso / Aminet / gfx / misc / gnuplot-3.7src.lha / gnuplot-3.7src / gnuplot-3.7.lha / gnuplot-3.7 / demo / density.fnc < prev    next >
Text File  |  1998-04-15  |  686b  |  27 lines

  1. #
  2. #   This is a rough approach to fit a model function to the density
  3. #   data of a liquid crystal. The function consists of a linear
  4. #   branch for the high temperature region and of a curved branch with
  5. #   linear asymptote for the low temperatuer branch
  6. #
  7.  
  8. #   free parameters:
  9. #   m1, m2  slopes of the linear function in the low and high T region
  10. #   Tc        transition temperature
  11. #   dens_Tc density at the transition temperature
  12. #   g        factor to scale tanh function
  13.  
  14. ml    = -0.0001
  15. mh    = -0.0001
  16. dens_Tc = 1.020
  17. Tc    = 45
  18. g    = 1
  19. b    = 0.1
  20.  
  21.  
  22. high(x) = mh*(x-Tc) + dens_Tc
  23. lowlin(x)  = ml*(x-Tc) + dens_Tc
  24. curve(x) = b*tanh(g*(Tc-x))
  25.  
  26. density(x) = x < Tc ? curve(x)+lowlin(x) : high(x)
  27.